﻿Partial Class TACO
    Inherits System.Web.UI.MasterPage
    Private mstrLanguage As String = "V"

    Private mcookie_language As HttpCookie
    Private mView As String = ""
    Private Const KEY_VIEW As String = "VIEW"

    Public Property PageIntroduce() As String
        Get
            Return Lbl_Introduce.Text
        End Get
        Set(ByVal value As String)
            Lbl_Introduce.Text = value
        End Set
    End Property

    Private Function ReadQueryString(ByRef pView As String) As Boolean
        pView = ""
        pView = Request.QueryString(KEY_VIEW)
        ReadQueryString = True
    End Function

    Protected Sub ContentPlaceHolder_TACO_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles ContentPlaceHolder_TACO.Load

        If Not IsPostBack Then ReadQueryString(mView)
        '-------------------------------------------
        If Request.Cookies("cookie_language") Is Nothing Then
            mcookie_language = New HttpCookie("cookie_language", "E")
            mcookie_language.Expires = DateTime.Now.AddDays(30)
            Response.Cookies.Add(mcookie_language)
        End If
        '------------------------------------------
        Select Case Request.Cookies("cookie_language").Value
            Case "E"
                'HyperLink_Homepage.Text = Resources.Default.txt_HomepageE ' : GlobalResource, French 'RM.GetString("txt_HomepageE")
                'HyperLink_About.Text = Resources.Default.txt_AboutE
                'HyperLink_Contact.Text = Resources.Default.txt_ContactE
                'Lbl_Wellcome.Text = Resources.Default.txt_WellcomeE

                'TabService1.mStrLangue = "EN"
                'TabNews1.mStrLangue = "EN"
                'BannerMainFlash_EN1.Visible = True
                'BannerMainFlash_VN1.Visible = False
                'BannerServiceFlash_EN.Visible = True
                'BannerServiceFlash_VN.Visible = False
            Case Else
                'HyperLink_Homepage.Text = Resources.Default.txt_HomepageV 'RM.GetString("txt_HomepageV")
                'HyperLink_About.Text = Resources.Default.txt_AboutV
                'HyperLink_Contact.Text = Resources.Default.txt_ContactV
                'Lbl_Wellcome.Text = Resources.Default.txt_WellcomeV

                ''TabService1.mStrLangue = "VN"
                ''TabNews1.mStrLangue = "VN"
                'BannerMainFlash_VN1.Visible = True
                'BannerMainFlash_EN1.Visible = False
                'BannerServiceFlash_VN.Visible = True
                'BannerServiceFlash_EN.Visible = False
        End Select

    End Sub

    Protected Sub ImageButton_Viet_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton_Viet.Click, ImageButton_Viet_2.Click
        mcookie_language = New HttpCookie("cookie_language", "V")
        mcookie_language.Expires = DateTime.Now.AddDays(30)
        Response.Cookies.Add(mcookie_language)

        Response.Redirect("Home.aspx", True)
        ChangeLanguage()
    End Sub

    Protected Sub ImageButton_English_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton_English.Click, ImageButton_Enlish2.Click
        mcookie_language = New HttpCookie("cookie_language", "E")
        mcookie_language.Expires = DateTime.Now.AddDays(30)
        Response.Cookies.Add(mcookie_language)

        'MultiView_Main.ActiveViewIndex = 0
        Response.Redirect("Home.aspx", True)
        ChangeLanguage()
    End Sub
    Private Sub ChangeLanguage()

    End Sub
End Class

